From 5f755d97eca4be072096894fc4da47adc7039b5b Mon Sep 17 00:00:00 2001 From: robertl Date: Sat, 13 Mar 2010 17:57:34 +0000 Subject: [PATCH] Only whack "extension" from pathname, not dirname, in bushnell. (testo uses dots in directory names...) --- bushnell.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bushnell.c b/bushnell.c index 5bcdea821..de55ac18d 100644 --- a/bushnell.c +++ b/bushnell.c @@ -157,13 +157,14 @@ rd_deinit(void) { static void wr_init(const char *fname) { - char *dot; + char *dot, *slash; ofname = xstrdup(fname); - // If user provided an extension, whack it. - dot = strchr(ofname, '.'); - if (dot) *dot = 0; + // If user provided an extension in the pathname, whack it. + dot = strrchr(ofname, '.'); + slash = strrchr(ofname, GB_PATHSEP); + if (dot > slash) *dot = 0; static char valid_chars [] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789" ".-/\\~@#$%^&*()_+=<>" -- 2.30.2